import { createSSRApp } from 'vue';
import { createI18n } from 'vue-i18n';
import * as Pinia from 'pinia';

import App from './App.vue';
import messages from './locale';

// #ifdef H5
const i18n = createI18n({
  locale: uni.getLocale(),
  messages
});
// #endif

export function createApp() {
  const app = createSSRApp(App);
  app.use(i18n);
  app.use(Pinia.createPinia());
  return {
    app
  };
}
